class Rental < ActiveRecord::Base

  belongs_to  :user
  belongs_to  :book

  validates_presence_of :pick_up

  def brazilian_format
    if self.day < 10
      day = "0" + self.day.to_s
    else
      day = self.day.to_s
    end

    if self.month < 10
      month = "0" + self.month.to_s
    else
      month = self.month.to_s
    end

      day
  end

end
